#ifndef DATACURVE_H
#define DATACURVE_H
#include <qwt_plot_curve.h>
#include <signaldata.h>

class Plot;
class DataCurve : public QwtPlotCurve
{
	friend class Plot;
private:
	DataCurve();
	~DataCurve();
	void addPoint(double x, double y);
	void clear(){ signal_data->clear(); }
	void setFeq(int _feq){ feq = _feq; ts = 1000 / feq; }
	void updateRect();
	QPointF& dataPoint(int idx){ return signal_data->at(idx); }
	int dataLength(){ return signal_data->size(); }
	SignalData* signal_data;
	int feq;
	int ts;
};

#endif // DATACURVE_H
